{extend name="base" /}
{block name="body"}
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">短信邮件模板管理</li>
            <li class=""><a href="{:url('admin/MsgAndMailConfig/add')}">添加模板</a></li>
            <li class=""><a href="{:url('admin/MsgAndMailConfig/message')}">短信配置</a></li>
            <li class=""><a href="{:url('admin/MsgAndMailConfig/mail')}">邮件配置</a></li>
        </ul>
        <div class="layui-tab-content">
            <!-- <form action="" method="post" class="ajax-form"> -->
                <div class="layui-tab-item layui-show">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th style="width: 30px;">ID</th>
                            <th>标题</th>
                            <th>code</th>
                            <th>类型</th>
                            <th>模板内容</th>
                            <th>添加人</th>
                            <th>状态</th>
                            <th>添加时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {foreach name="list" item="vo"}
                        <tr>
                            <td>{$vo.id}</td>
                            <td>{$vo.title}</td>
                            <td>{$vo.code}</td>
                            <td>{if $vo.type == 0}短信模板{elseif $vo.type == 1}邮件模板{/if}</td>
                            <td>{$vo.content}</td>
                            <td>{$vo.create_user}</td>
                            <td>{if $vo.status == 0}已启用{elseif $vo.status == 1}已禁用{/if}</td>
                            <td>{$vo.create_time}</td>
                            <td>
                                <a href="{:url('admin/MsgAndMailConfig/edit', ['id' => $vo['id']])}" class="layui-btn layui-btn-normal layui-btn-mini">编辑</a>
                                {eq name='$vo["id"]' value='2'}
                                {else /}
                                <button class="layui-btn layui-btn-warm layui-btn-mini ajax-action" data-action="{:url('admin/MsgAndMailConfig/delete', ['id' => $vo['id']])}">删除</button>

                                {/eq}

                                {if $vo.status == 0}
                                    <button class="layui-btn layui-btn-warm layui-btn-mini ajax-action" data-action="{:url('admin/MsgAndMailConfig/status', ['id' => $vo['id'], 'status' => 1])}">禁用</button>
                                {elseif $vo.status == 1}
                                    <button class="layui-btn layui-btn-normal layui-btn-mini ajax-action" data-action="{:url('admin/MsgAndMailConfig/status', ['id' => $vo['id'], 'status' => 0])}">启用</button>
                                {/if}
                            </td>
                        </tr>
                        {/foreach}
                        </tbody>
                    </table>
                    <!--分页-->
                    {$page}
                </div>
            <!-- </form> -->
        </div>
    </div>
</div>
{/block}